import { Observer } from "mobx-react";
import { observer, useLocalObservable } from "mobx-react-lite";
import store from "./mobx";
export default function MobxPage() {
  const r_store = useLocalObservable(() => store);

  const CountView = observer(() => {
    return (
      <div>
        <div>{r_store.count}</div>
        <div>{r_store.info.name}</div>
        <div>{r_store.count_double}</div>
        <button onClick={() => r_store.add_count()}>add</button>
        <button onClick={console.log(r_store)}>log</button>
      </div>
    );
  });
  return (
    <div>
      <h1>mobx</h1>
      <CountView></CountView>
    </div>
  );
}
